package org.x.casemodule.enums;

import javax.swing.text.View;

public enum PermissionEnum {
    //'VIEW','EDIT'
    VIEW("VIEW", "查看"),
    EDIT("EDIT", "编辑");
    private String code;
    private String name;
    PermissionEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }
    public String getCode() {
        return code;
    }
    public String getName() {
        return name;
    }
    public static PermissionEnum getByCode(String code) {
        for (PermissionEnum value : PermissionEnum.values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }
    public static PermissionEnum getByName(String name) {
        for (PermissionEnum value : PermissionEnum.values()) {
            if (value.name.equals(name)) {
                return value;
            }
        }
        return null;
    }



}
